from flask_restful import Resource

from restful.api__.session import admin_required_current_admin_generate
from restful.model.query import QueryMultipleInstances
from restful.model.tables import Blog
from restful.response import ResponseSuccess


class SystemAllPostsUnchecked(Resource):
    @admin_required_current_admin_generate
    def get(self,current_admin):
        posts=QueryMultipleInstances(Blog,{'checked':False})
        return ResponseSuccess(data=[{
            'pid':i.pid,
        }for i in posts])